package com.my.chapter8;

public class practice14 {
    public static void main(String[] args) {
        Mouse2[] m = {new Mouse2(),new Mouse2(),new Mouse2()};
    }
}

class Rodent2{
    public void eat(){
        System.out.println("啮齿动物吃东西");
    }
}

class Mouse2 extends Rodent2{
    private static int id = 0;
    Mouse2(){
        id++;
        System.out.println("Creating "+this);
    }
    public void eat(){
        System.out.println("老鼠吃东西");
    }

    @Override
    public String toString() {
        return "Mouse "+id;
    }
}
